Skip to content

Conversation

@basvandijk
Copy link
Collaborator

@basvandijk basvandijk commented May 24, 2025

This fixes the reproducibility of //rs/ic_os/config:config in #5264 by using the same trick as used in rs/http_endpoints/public/build.rs.

The reason it was non-reproducible before:

  1. The askama macro calls the include_bytes!(#path) macro where path will be an absolute path to the template which will be unique for every Bazel invocation
  2. The output of proc_macros will be hashed and end up in the crate's metadata hash.
  3. Since the output of the askama macro is different for every Bazel invocation the crate's metadata hash will be different every time.
  4. The crate metadata hash is an input to generated symbol names during code generation.
  5. This means that we get different symbol names for every Bazel invocation. This can be observed when running diffoscope on the binaries.

@github-actions github-actions bot added the fix label May 24, 2025
@basvandijk basvandijk marked this pull request as ready for review May 24, 2025 09:44
@basvandijk basvandijk requested a review from a team as a code owner May 24, 2025 09:44
@frankdavid frankdavid merged commit 8cc475e into frankdavid/generate-vm-config May 26, 2025
20 checks passed
@frankdavid frankdavid deleted the basvandijk/fix-reproducility-of-generate-vm-config branch May 26, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants